<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="test">
    <button v-on:click="flag=!flag">点击</button>
    <button @click="flag=!flag">点击</button>
    <table v-if="flag" style="background-color: red">
        <tr v-for="user in users">
            <td v-text="user.name"></td>
            <td v-text="user.gender"></td>
            <td v-text="user.age"></td>
        </tr>
    </table>
    <table v-show="!flag" style="background-color: green">
        <tr v-for="user in users">
            <td v-text="user.name"></td>
            <td v-text="user.gender"></td>
            <td v-text="user.age"></td>
        </tr>
    </table>

</div>
</body>
<script src="./node_modules/vue/dist/vue.js"></script>
<script type="text/javascript">
    let text = new Vue({
        el: "#test",
        data: {
            users:[
                {name:'柳岩', gender:'女', age: 21},
                {name:'有哥', gender:'男', age: 30},
                {name:'范冰冰', gender:'女', age: 24},
                {name:'刘亦菲', gender:'女', age: 18},
                {name:'古力娜扎', gender:'女', age: 25}
            ],
            flag: true
        }
    });
</script>
</html>